package com.yyfax.pay.depository.dao;

import com.yyfax.pay.depository.domain.FuiouUserRegister;
import org.apache.ibatis.annotations.Param;

/**
 * 个人用户开户DAO
 *
 * @author yejc
 * @date 2017-11-09
 * @since v2.0.0
 */
public interface FuiouUserRegisterDao {
	/**
	 * 根据主键删除
	 *
	 * @author yejc
	 * @date 2017-11-09
	 * @since v2.0.0
	 */
	int deleteByPrimaryKey(String busiId);

	/**
	 * 保存实体对象
	 *
	 * @author yejc
	 * @date 2017-11-09
	 * @since v2.0.0
	 */
	int insert(FuiouUserRegister record);

	/**
	 * 根据主键查询
	 *
	 * @author yejc
	 * @date 2017-11-09
	 * @since v2.0.0
	 */
	FuiouUserRegister selectByPrimaryKey(String busiId);

	/**
	 * 根据主键更新
	 *
	 * @author yejc
	 * @date 2017-11-09
	 * @since v2.0.0
	 */
	int updateByPrimaryKey(FuiouUserRegister record);

	/**
	 * 根据主键和状态更新状态
	 *
	 * @param oriState
	 * @param tarState
	 * @param busiId
	 * @param currentDateTime
	 * @return
	 * @author yejc
	 * @date 2017-11-09
	 * @since v2.0.0
	 */
	// int updateStateByBusiId(@Param("oriState") String oriState, @Param("tarState") String tarState, @Param("busiId") String busiId,
	// @Param("currentDateTime") String currentDateTime);

	/**
	 * 更新订单状态
	 * 
	 * @author buyi
	 * @date 2018-01-15 11:13:37
	 * @since v2.0.4
	 * @param busiId
	 * @param destState
	 * @param origState
	 * @param rspCode
	 * @param rspMsg
	 * @return
	 */
	public int updateStateByBusiId(@Param("busiId") String busiId, @Param("destState") String destState, @Param("origState") String origState,
			@Param("rspCode") int rspCode, @Param("rspMsg") String rspMsg);

	/**
	 * 根据订单号和商户号查询
	 *
	 * @param orderId
	 * @param merchantCode
	 * @return
	 * @author yejc
	 * @date 2017-11-09
	 * @since v2.0.0
	 */
	FuiouUserRegister selectByOrderIdMerchantCode(@Param("orderId") String orderId, @Param("merchantCode") String merchantCode);

	/**
	 * 根据主键更新状态和响应
	 *
	 * @param state
	 * @param busiId
	 * @param currentDateTime
	 * @param rspCode
	 * @param rspMsg
	 * @return
	 * @author yejc
	 * @date 2017-11-09
	 * @since v2.0.0
	 */
	int updateStateAndRspByBusiId(@Param("state") String state, @Param("busiId") String busiId, @Param("currentDateTime") String currentDateTime,
			@Param("rspCode") Integer rspCode, @Param("rspMsg") String rspMsg);

	/**
	 * 四要素查询开户订单
	 *
	 * @param merchantCode 商户号
	 * @param userId 用户id
	 * @param custName 用户名
	 * @param idCard 身份证
	 * @param bankCardNo 银行卡
	 * @param phone 电话
	 * @return FuiouUserRegister
	 * @author liangqm
	 * @date 2018-01-10
	 * @since v2.0.7
	 */
	FuiouUserRegister selectByFourElements(@Param("merchantCode") String merchantCode, @Param("userId") String userId,
			@Param("custName") String custName, @Param("idCard") String idCard, @Param("bankCardNo") String bankCardNo, @Param("phone") String phone,
			@Param("respCode") Integer respCode);
}